home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s2.arc
/
MINMAX.MOD
< prev
next >
Wrap
Text File
|
1987-05-04
|
4KB
|
69 lines
(*----------------------------------------------------------------------*)
(* Min --- Find minimum of two integers *)
(*----------------------------------------------------------------------*)
FUNCTION Min( A, B: INTEGER ) : INTEGER;
(*----------------------------------------------------------------------*)
(* *)
(* Function: Min *)
(* *)
(* Purpose: Returns smaller of two numbers *)
(* *)
(* Calling sequence: *)
(* *)
(* Smaller := MIN( A , B ) : INTEGER; *)
(* *)
(* A --- 1st input integer number *)
(* B --- 2nd input integer number *)
(* Smaller --- smaller of A, B returned *)
(* *)
(* *)
(* Calls: None *)
(* *)
(* *)
(*----------------------------------------------------------------------*)
BEGIN (* Min *)
IF ( A < B ) THEN
Min := A
ELSE
Min := B;
END (* Min *);
(*----------------------------------------------------------------------*)
(* Max --- Find maximum of two integers *)
(*----------------------------------------------------------------------*)
FUNCTION Max( A, B: INTEGER ) : INTEGER;
(*----------------------------------------------------------------------*)
(* *)
(* Function: Max *)
(* *)
(* Purpose: Returns larger of two numbers *)
(* *)
(* Calling sequence: *)
(* *)
(* Larger := MAX( A , B ) : INTEGER; *)
(* *)
(* A --- 1st input integer number *)
(* B --- 2nd input integer number *)
(* Larger --- Larger of A, B returned *)
(* *)
(* *)
(* Calls: None *)
(* *)
(*----------------------------------------------------------------------*)
BEGIN (* Max *)
IF ( A > B ) THEN
Max := A
ELSE
Max := B;
END (* Max *);